new Vue({
	el:'#app',
	data:{
		account:'',
		password:'',
		code:'',
		url:'/doctor/Code/getCode'+'?'+Math.random(),
	},
	methods:{
		login() {
			
		    $.ajax("/doctor/AdminUser/login", {
		        type: "POST",
		        data: {
		            account: this.account,
		            password: this.password,
		            code:this.code
		        },
		        success: function(data, textStatus) {
					console.log(data)
		            // var dataList = data.split("\r\n");
		            let datas = JSON.parse(data);
		            if (datas.statusCode == 200) {
		                let user = JSON.stringify(datas.datas.user);
		
		                sessionStorage.setItem("user", user);
		
		                alert(datas.errMsg);
						
						
						location.href="href?to="+datas.location;
		               
		
		
		            } else {
		                alert(datas.errMsg)
		            }
		        }
		    })
		
		},
		changeCode(param) {
		    this.url = '/doctor/Code/getCode'+'?'+Math.random();
		}
	}
})